oPet = oUF:NewModule("oUF_Pet", oUF.unit.pet)
local G = getfenv(0)

function oPet:Enable()
	self:disableBlizzard()
	oUF.unit.pet = oUF.class.unit:new("pet")
	oUF.unit.pet:loadPosition()
	self:RegisterEvent("UNIT_PET", "update")
	self:RegisterEvent("UNIT_HAPPINESS", "update")
end

function oPet:update()
	if UnitExists("pet") then
		oUF.unit.pet:updateAll()
	end
end

function oPet:disableBlizzard()
	G["PetFrame"]:UnregisterAllEvents()
	G["PetFrame"]:Hide()
end
